<template>
  <div id="app" :style="{ backgroundImage: `url(${backgroundImageUrl})` }">
    <div class="container">
      <h1>Android App Bundle 安装工具</h1>
      <AabInstaller />
    </div>
  </div>
</template>

<script>
import AabInstaller from './components/AabInstaller.vue';

export default {
  components: {
    AabInstaller
  },
  data() {
    return {
      backgroundImageUrl: ''
    };
  },
  mounted() {
    this.getBingWallpaper();
  },
  methods: {
    getBingWallpaper() {
      fetch(`${process.env.VUE_APP_API_BASE_URL}/bing-wallpaper`)
        .then(response => response.json())
        .then(data => {
          this.backgroundImageUrl = data.url;
        })
        .catch(error => {
          console.error('Error fetching Bing wallpaper:', error);
        });
    }
  }
};
</script>

<style>
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#app {
  height: 100%;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: rgba(255, 255, 255, 0.8);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 90%;
  margin: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}
</style> 